From 321753f1adef025cc14b76c6afad27500e8f210a Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 6 Oct 2011 16:19:03 +0100 Subject: [PATCH] libxlu: correctly parse disk "backendtype" field Currently it tries to parse the value from the full "backendtype=FOO" string but really it needs to parse from the equals. Before: # xl -N block-attach d32-1 backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b command line: config parsing error in disk specification: unknown value for backendtype: near `backendtype=phy' in `backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b' After [in new syntax, not yet in this tree -iwj]: # xl -N block-attach d32-1 backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b disk: { "backend_domid": 0, "pdev_path": "/dev/VG/debian-x86_32-1b", "vdev": "xvdb", "backend": "phy", "format": "raw", "script": null, "removable": 0, "readwrite": 1, "is_cdrom": 0 } Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/libxl/libxlu_disk_l.c | 2 +- tools/libxl/libxlu_disk_l.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c index 867bb19e0e..1ed1ec548c 100644 --- a/tools/libxl/libxlu_disk_l.c +++ b/tools/libxl/libxlu_disk_l.c @@ -1261,7 +1261,7 @@ case 8: /* rule 8 can match eol */ YY_RULE_SETUP #line 142 "libxlu_disk_l.l" -{ STRIP(','); setbackendtype(DPC,yytext); } +{ STRIP(','); setbackendtype(DPC,FROMEQUALS); } YY_BREAK case 9: /* rule 9 can match eol */ diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l index 8c786fc7ff..22037d6f17 100644 --- a/tools/libxl/libxlu_disk_l.l +++ b/tools/libxl/libxlu_disk_l.l @@ -139,7 +139,7 @@ devtype=disk,? { DPC->disk->is_cdrom = 0; } devtype=[^,]*,? { xlu__disk_err(DPC,yytext,"unknown value for type"); } access=[^,]*,? { STRIP(','); setaccess(DPC, FROMEQUALS); } -backendtype=[^,]*? { STRIP(','); setbackendtype(DPC,yytext); } +backendtype=[^,]*? { STRIP(','); setbackendtype(DPC,FROMEQUALS); } vdev=[^,]*,? { STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); } script=[^,]*,? { STRIP(','); SAVESTRING("script", script, FROMEQUALS); } -- 2.30.2